<template>
  <view>
    123
    <text>用户名：{{usernames}}</text>
    <button @click="alterName">点击</button>
    <button @click="computeDate()">计算日期</button>


  </view>
</template>
<script>
  import store from '@/store/index.js' //需要引入store
  import { computed } from 'vue'
  export default {
    data() {
      return { username: '小明', numbers: [1, 2, 3, 4, 5] }
    },
    computed: {
      usernames() {
        // return store.state.username
        return this.username
      }
    },
    methods: {
      alterName() {
        this.username = this.username + '1'
      },
      goto() {
        return false
      },
      // 计算日期
      computeDate() {
        // let date1 = '06月26号'
        // let date2 = '06月27号'
        let date1 = '16'
        let date2 = '06'
        console.log(date1 - date2)
      }
    },
    onLoad() {
      console.log(this.goto())
    }
  }
</script>


<style lang="scss"></style>